<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>第一个JSP程序</title>
        <script type="text/javascript" src="../jquery-1.8.3.js"></script>
        <script type="text/javascript">
            $(function() {
                $.get("02.xml",function(data){
                    alert($(data).find("person").html());
                    //或者用.text取元素
                    alert($(data).find("person").text());
                    //得到值不会把根对象包装在包装器中 需要find
                    alert(data.getElementsByTagName("h1").length);
                },"xml");

                $.get("user.json",function(data){
                    alert(data.name);
                },"json");
                $.getJSON("user.json",function(data){
                    alert(data.name);
                });
            });
        </script>
    </head>
    <body>
        <h1>使用JQuery实现Ajax</h1>
        <div id="content"></div>

    </body>
</html>
